package com.example.finger.activity;

import android.content.IntentFilter;
import android.os.Bundle;

import com.example.finger.bean.SoketOrder;
import com.example.finger.socket.ServiceBroadcastReceiver;
import com.lyxmaster.lib.view.BaseActivity;

/**
 * Created by LU-MAC on 2018/11/18.
 */

public class MyBaseActivity extends BaseActivity {
    public ServiceBroadcastReceiver serviceBroadcastReceiver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume(){
        super.onResume();

        serviceBroadcastReceiver = new ServiceBroadcastReceiver();
        IntentFilter filter = new IntentFilter(SoketOrder.CLOSE);
        filter.addAction(SoketOrder.CollectionFinger);
        filter.addAction(SoketOrder.PUTMANAGERFINGER);
        filter.addAction(SoketOrder.DOWNLOADTASK);
        this.registerReceiver(serviceBroadcastReceiver, filter);
    }

    @Override
    public void onPause(){
        super.onPause();
        this.unregisterReceiver(serviceBroadcastReceiver);
    }
}
